package com.yeyks.controller.other;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.common.base.PageResult;
import com.yeyks.common.param.PageParam;
import com.yeyks.other.dal.domain.RecruitmentOfCityPartners;
import com.yeyks.other.service.RecruitmentOfCityPartnersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "城市合伙人接口")
@RestController
@RequestMapping("/city/partner")
public class CityPartnersController {

    @Autowired
    private RecruitmentOfCityPartnersService cityPartnersService;

    @ApiOperation("列表 --> v4.3")
    @PostMapping("/list")
    public AjaxResponseBody<PageResult<RecruitmentOfCityPartners>> list(PageParam pageParam) {
        PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
        List<RecruitmentOfCityPartners> list = cityPartnersService.list(new QueryWrapper<RecruitmentOfCityPartners>().orderByDesc(RecruitmentOfCityPartners.CREATE_TIME));
        return AjaxResponseBody.success(PageResult.getPageResult(list));
    }


}
